package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YongyouWldaMapper;
import com.ruoyi.quartz.domain.YongyouWlda;
import com.ruoyi.quartz.service.IYongyouWldaService;

/**
 * 物料档案Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-17
 */
@Service
public class YongyouWldaServiceImpl implements IYongyouWldaService 
{
    @Autowired
    private YongyouWldaMapper yongyouWldaMapper;

    /**
     * 查询物料档案
     * 
     * @param name 物料档案主键
     * @return 物料档案
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public YongyouWlda selectYongyouWldaByName(String name)
    {
        return yongyouWldaMapper.selectYongyouWldaByName(name);
    }

    /**
     * 查询物料档案列表
     * 
     * @param yongyouWlda 物料档案
     * @return 物料档案
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<YongyouWlda> selectYongyouWldaList(YongyouWlda yongyouWlda)
    {
        return yongyouWldaMapper.selectYongyouWldaList(yongyouWlda);
    }

    /**
     * 新增物料档案
     * 
     * @param yongyouWlda 物料档案
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertYongyouWlda(YongyouWlda yongyouWlda)
    {
        return yongyouWldaMapper.insertYongyouWlda(yongyouWlda);
    }

    /**
     * 修改物料档案
     * 
     * @param yongyouWlda 物料档案
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateYongyouWlda(YongyouWlda yongyouWlda)
    {
        return yongyouWldaMapper.updateYongyouWlda(yongyouWlda);
    }

    /**
     * 批量删除物料档案
     * 
     * @param names 需要删除的物料档案主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouWldaByNames(String[] names)
    {
        return yongyouWldaMapper.deleteYongyouWldaByNames(names);
    }

    /**
     * 删除物料档案信息
     * 
     * @param name 物料档案主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouWldaByName(String name)
    {
        return yongyouWldaMapper.deleteYongyouWldaByName(name);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearWlda() {
        return yongyouWldaMapper.clearWlda();
    }
}
